Skip to content

REGCA Documentation + More Function Primitives#404

Open
lukelowry wants to merge 12 commits into
developfrom
lukel/regca-docs
Open

REGCA Documentation + More Function Primitives#404
lukelowry wants to merge 12 commits into
developfrom
lukel/regca-docs

Conversation

@lukelowry
Copy link
Copy Markdown
Collaborator

@lukelowry lukelowry commented May 17, 2026

Description

Draft of REGCA machine-like and REECA exciter-like IBR model specification, which relies on new function primitives in CommonMath . Helps standardize the smooth-ization of the common model components and increases readability. These primitives will be used extensively in the upcoming IBR models.

@abirchfield @BSzymanowski I needed this for the theory section of the HICSS paper ASAP and realized I could construct most of the noncontinuous features with a ramp function primitive. I changed the variable names because the diagram doesn't match my expectations. Let me know what you think, and compare it against any progress you have made on this model, please

@nkoukpaizan Enzyme is starting to make sense to me, so I think I made changes correctly. Please check my CommonMath work!

Proposed changes

  • REGCA Model Documentation
  • REECA Model Documentation
  • CommonMath Primitive functions
    • ramp
    • qramp
  • CommonMath Derived functions
    • min
    • max
    • linseg
    • clamp
    • slew
    • antiwindup
  • IEEEST refinement using new CommonMath, but also removing the output limiter, which seems to be incorrectly documented in the Power World reference. The functionality appears unclear and inconsistent across different sources. Many do not include it on the IEEEST, so I removed it since it was proving difficult to comply with Enzyme.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

All in preparation for the two IBR models REGCA and REECA, which I have working implementations for.

@lukelowry lukelowry force-pushed the lukel/regca-docs branch 2 times, most recently from 4ce662c to 0d135d9 Compare May 17, 2026 18:04
@lukelowry lukelowry requested review from BSzymanowski, abirchfield and nkoukpaizan and removed request for BSzymanowski and nkoukpaizan May 17, 2026 22:23
@BSzymanowski BSzymanowski marked this pull request as ready for review May 18, 2026 21:47
@BSzymanowski
Copy link
Copy Markdown
Collaborator

Looks good to me.

Copy link
Copy Markdown
Collaborator

@nkoukpaizan nkoukpaizan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have to go through some of the math and related tests. A few preliminary comments.

Comment thread GridKit/Model/PhasorDynamics/Converter/README.md
Comment thread GridKit/Model/PhasorDynamics/Converter/REGCB/README.md
Comment thread GridKit/Model/PhasorDynamics/Converter/REGCA/README.md
Comment thread GridKit/CommonMath.md Outdated
Comment thread GridKit/CommonMath.md Outdated
Comment thread GridKit/Model/PhasorDynamics/Converter/REECA/README.md
Comment thread GridKit/CommonMath.md Outdated
Comment thread GridKit/Model/PhasorDynamics/Stabilizer/IEEEST/README.md Outdated
Comment thread GridKit/CommonMath.md Outdated
Comment thread GridKit/CommonMath.md Outdated
@lukelowry
Copy link
Copy Markdown
Collaborator Author

@abirchfield Clear for your review!

Adding these primitives has been very helpful for readability and will help when we fine-tune the solver for all models with state-space discretization unilaterally.

@pelesh
Copy link
Copy Markdown
Collaborator

pelesh commented May 21, 2026

@lukelowry, for faster reviews in the future, I suggest you break PRs like this in single-topic PRs.

@lukelowry
Copy link
Copy Markdown
Collaborator Author

@pelesh That is my fault. For various reasons, it turned into a general cleanup + a reference for another branch of mine, so I let it grow. I'll do better with the rest!

Copy link
Copy Markdown
Collaborator

@nkoukpaizan nkoukpaizan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me. A few comments on the common math tests. Please try to minimize the number of hard-coded values.

I would like @abirchfield to approve the new model documentations.

Comment thread tests/UnitTests/Math/SmoothnessIndicatorTests.hpp Outdated
Comment thread tests/UnitTests/Math/SmoothnessIndicatorTests.hpp Outdated
Comment thread tests/UnitTests/Math/SmoothnessIndicatorTests.hpp Outdated
Comment thread GridKit/CommonMath.hpp Outdated
@lukelowry
Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan Complete, I am glad you pushed back on the tests because they are more readable now. Just awaiting @abirchfield

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants